home *** CD-ROM | disk | FTP | other *** search
/ Revista do CD-ROM 8 / Revista do CD-ROM 8.iso / dados / program / skyborg / skyborg.exe / SHARED.DXR / 01010_User Engine.ls < prev    next >
Encoding:
Text File  |  1995-07-24  |  3.5 KB  |  110 lines

  1. on keyDown
  2.   global gRobotAlive, gCurrentSite
  3.   if charToNum(the key) = 6 then
  4.     set gRobotAlive to 1
  5.     ShowSite(gCurrentSite, 0, 0)
  6.     exit
  7.   end if
  8.   if (the key = "q") or (the key = "Q") then
  9.     ShowSite("GameStop", 23, 0)
  10.     wait(120)
  11.     repeat with count = 1 to 48
  12.       puppetSprite(count, 0)
  13.     end repeat
  14.     go("Black")
  15.     updateStage()
  16.     wait(10)
  17.     quit()
  18.   end if
  19. end
  20.  
  21. on ProcessUIClick thisSprite
  22.   global cArmSprite, myCast
  23.   if thisSprite = (cArmSprite + 1) then
  24.     ExitUserInterface()
  25.   end if
  26.   if thisSprite = (cArmSprite + 5) then
  27.     set thisCast to "Save_2"
  28.     set myNewCast to getaProp(myCast, thisCast)
  29.     set the castNum of sprite thisSprite to myNewCast
  30.     updateStage()
  31.     myPlaySound("GlyphSound")
  32.     wait(15)
  33.     set thisCast to "Save_1"
  34.     set myNewCast to getaProp(myCast, thisCast)
  35.     set the castNum of sprite thisSprite to myNewCast
  36.     updateStage()
  37.   end if
  38.   if thisSprite = (cArmSprite + 6) then
  39.     set thisCast to "Start_2"
  40.     set myNewCast to getaProp(myCast, thisCast)
  41.     set the castNum of sprite thisSprite to myNewCast
  42.     updateStage()
  43.     myPlaySound("GlyphSound")
  44.     wait(15)
  45.     set thisCast to "Start_1"
  46.     set myNewCast to getaProp(myCast, thisCast)
  47.     set the castNum of sprite thisSprite to myNewCast
  48.     updateStage()
  49.     buildCastIndex()
  50.     InitNewGame()
  51.     SetUpEngine()
  52.     SetUpWorld()
  53.     UpdateHUDWeapon()
  54.     ShowSite(gCurrentSite, 0, EMPTY)
  55.   end if
  56. end
  57.  
  58. on ShowUserInterface
  59.   global cPanFirstRegion, gUserInterfaceOn, cArmSprite, cArmSpriteMax, myCast, gNeutralCursor, oldBrightness, oldBrightAdjust, gBrightness, gBrightAdjust
  60.   set oldBrightness to gBrightness
  61.   set oldBrightAdjust to gBrightAdjust
  62.   set gBrightness to 0
  63.   set gBrightAdjust to 0
  64.   UpdatePalettes()
  65.   go("UserInterface")
  66.   set gUserInterfaceOn to 1
  67.   cardSound()
  68.   repeat with thisSprite = cArmSprite + 1 to cArmSpriteMax + cArmSprite - 1
  69.     spriteBox(thisSprite, 0, 500, 1, 501)
  70.   end repeat
  71.   set UserRects to "UserBackground, 0, 0, 640, 390, 0"
  72.   put RETURN & "Credits_1 ,345, 111, 617, 164, 0" after UserRects
  73.   put RETURN & "Load_1,30, 111, 302, 164, 0" after UserRects
  74.   put RETURN & "Quit_1,345, 182, 617, 235, 0" after UserRects
  75.   put RETURN & "Save_1,30, 182, 302, 235, 0" after UserRects
  76.   put RETURN & "Start_1,30, 41, 302, 94, 0" after UserRects
  77.   set count to 0
  78.   repeat with thisSprite = cArmSprite + 1 to cArmSprite + 6
  79.     set count to count + 1
  80.     puppetSprite(thisSprite, 1)
  81.     set the cursor of sprite thisSprite to gNeutralCursor
  82.     set thisCast to item 1 of line count of UserRects
  83.     set myNewCast to getaProp(myCast, thisCast)
  84.     set the castNum of sprite thisSprite to myNewCast
  85.     set temp.left to value(item 2 of line count of UserRects)
  86.     set temp.top to value(item 3 of line count of UserRects)
  87.     set temp.right to value(item 4 of line count of UserRects)
  88.     set temp.bottom to value(item 5 of line count of UserRects)
  89.     spriteBox(thisSprite, temp.left, temp.top, temp.right, temp.bottom)
  90.     set the ink of sprite thisSprite to value(item 6 of line count of UserRects)
  91.   end repeat
  92.   puppetTransition(5, 1, 16, 1)
  93.   updateStage()
  94. end
  95.  
  96. on ExitUserInterface
  97.   global gUserInterfaceOn, cArmSprite, cArmSpriteMax, gInvArmState, oldBrightness, gBrightness, oldBrightAdjust, gBrightAdjust
  98.   set gUserInterfaceOn to 0
  99.   set gBrightness to oldBrightness
  100.   set gBrightAdjust to oldBrightAdjust
  101.   UpdatePalettes()
  102.   cardSound()
  103.   repeat with thisSprite = cArmSprite to cArmSprite + cArmSpriteMax
  104.     spriteBox(thisSprite, 0, 500, 1, 501)
  105.   end repeat
  106.   puppetTransition(6, 1, 16, 1)
  107.   set the itemDelimiter to ","
  108.   go("Motion")
  109. end
  110.